package com.shangrila.biz.domain;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;

import com.shangrila.common.lang.Money;
import com.taobao.api.domain.PromotionInItem;
import com.taobao.api.domain.PromotionInShop;

public class TaokeItem implements Serializable {
	private static final long serialVersionUID = -8538334817356638346L;
	/** 宝贝id */
	private long itemId;
	/** 宝贝标题 */
	private String title;
	/** 卖家昵称 */
	private String sellerNick;
	/** 宝贝价格 */
	private Money price;
	/** 宝贝折扣价格 */
	private Money couponPrice;
	/** 淘客Url */
	private String taokeUrl;
	/**shop推广链接*/
	private String shopUrl;
	/** 主图地址 */
	private String mainPicUrl;
	/** 5张图片地址 */
	private List<String> picList;
	/**商品所属卖家的信用等级*/
	private Long sellerCreditScore;
	/**单品级优惠信息*/
	private List<PromotionInItem> promotionInItemList;
	/**店铺级别优惠信息*/
	private List<PromotionInShop> promotionInShopList;
	

	public long getItemId() {
		return itemId;
	}

	public void setItemId(long itemId) {
		this.itemId = itemId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSellerNick() {
		return sellerNick;
	}

	public void setSellerNick(String sellerNick) {
		this.sellerNick = sellerNick;
	}

	public Money getPrice() {
		return price;
	}

	public void setPrice(Money price) {
		this.price = price;
	}

	public Money getCouponPrice() {
		Money init = new Money(0);
		if(CollectionUtils.isNotEmpty(promotionInItemList)){
			for(PromotionInItem item : promotionInItemList){
				Money m = new Money(item.getItemPromoPrice());
				if(init.compareTo(m) < 0){
					init = m ;
				}
			}
		}
		if(new Money(0).compareTo(init) < 0){
			couponPrice = init;
		}
		return couponPrice;
	}

	public void setCouponPrice(Money couponPrice) {
		this.couponPrice = couponPrice;
	}

	public String getTaokeUrl() {
		return taokeUrl;
	}

	public void setTaokeUrl(String taokeUrl) {
		this.taokeUrl = taokeUrl;
	}

	public String getShopUrl() {
		return shopUrl;
	}

	public void setShopUrl(String shopUrl) {
		this.shopUrl = shopUrl;
	}

	public String getMainPicUrl() {
		return mainPicUrl;
	}

	public void setMainPicUrl(String mainPicUrl) {
		this.mainPicUrl = mainPicUrl;
	}

	public List<String> getPicList() {
		return picList;
	}

	public void setPicList(List<String> picList) {
		this.picList = picList;
	}

	public Long getSellerCreditScore() {
		return sellerCreditScore;
	}

	public void setSellerCreditScore(Long sellerCreditScore) {
		this.sellerCreditScore = sellerCreditScore;
	}

	public List<PromotionInItem> getPromotionInItemList() {
		return promotionInItemList;
	}

	public void setPromotionInItemList(List<PromotionInItem> promotionInItemList) {
		this.promotionInItemList = promotionInItemList;
	}

	public List<PromotionInShop> getPromotionInShopList() {
		return promotionInShopList;
	}

	public void setPromotionInShopList(List<PromotionInShop> promotionInShopList) {
		this.promotionInShopList = promotionInShopList;
	}
}
